/**
 * Created by LiuLuKang on 2017/10/16.
 */
$(document).ready(function () {
//轮播：
	var count = 0;
	$(".btnLeft").click(function () {
		count++;
		if (count == 4) {
			count = 0;
		}
		$(".bannerBody").css({"opacity": "0"}).eq(count).css({"opacity": "1"});
	});
	$(".btnRight").click(function () {
		count--;
		if (count == -1) {
			count = 3;
		}
		$(".bannerBody").css({"opacity": "0"}).eq(count).css({"opacity": "1"});
	});


	//滚动条监听：
	setInterval(scroll,1);
	function scroll() {
		if ($(window).scrollTop() >= $(window).height()) {
			$(".nav").css({"position": "fixed", "left": "0", "top": "0", "z-index": 100})
		} else {
			$(".nav").css({"position": "relative", "left": "0", "top": "0", "z-index": 100})
		}
	}
});